#ifndef BASEENTITY_H
#define BASEENTITY_H

#include <QJsonArray>
#include <QJsonObject>
#include <QString>
#include <QStringList>

class BaseEntity{
public:
    QString searchValue;
    QString createBy;
    QString createTime;
    QString updateBy;
    QString updateTime;
    QString remark;

    QJsonObject toJson() const {
        QJsonObject json;
        json["searchValue"] = searchValue;
        json["createBy"] = createBy;
        json["createTime"] = createTime;
        json["updateBy"] = updateBy;
        json["updateTime"] = updateTime;
        json["remark"] = remark;
        return json;
    }

    static BaseEntity toBaseEntity(const QJsonObject& obj) {
        BaseEntity entity;
        entity.searchValue = obj["searchValue"].toString();
        entity.createBy = obj["createBy"].toString();
        entity.createTime = obj["createTime"].toString();
        entity.updateBy = obj["updateBy"].toString();
        entity.updateTime = obj["updateTime"].toString();
        entity.remark = obj["remark"].toString();
        return entity;
    }
};

#endif // BASEENTITY_H
